prepping RPI for embedded dev

2021-02-14 · 1 min read

host: SSH into new rpi #

$ ssh rpi00.local

rpi: update and install basic tools #

$ sudo apt update && sudo apt upgrade
$ sudo apt install vim

rpi: configure systemd journal to only log to RAM #

This step helps avoid lots of IO writes to the SD Card, which will significantly extend its lifetime.

$ sudo cat > /etc/systemd/journald.conf.d/ram-only-journal.conf <<EOF
[Journal]
Storage=volatile
RuntimeMaxUse=100M
ForwardToSyslog=no
EOF

rpi: (optional) set rpi hostname #

It takes too long to build a new image with a different hostname, so we'll set the hostname after the fact. Make sure the hostname is not the default raspberrypi.

$ sudo hostnamectl set-hostname kyoto

rpi: (optional) add other ssh pubkeys #

Forgot to add this when formatting the SD card...

$ echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB3x6Xx0674lyf2DGstduaGjyA1ARqdeGc6PgHZMbwCK philiphayes@philiphayes-mbp" >> ~/.ssh/authorized_keys

rpi: (optional) enable kernel I2C bus #

$ sudo raspi-config

Select Interface Options > Enable I2C

rpi: (optional) enable kernel SPI Bus #

$ sudo raspi-config

Select Interface Options > Enable SPI

rpi: (optional) enable kernel PWM controller #

In /boot/config, add the line: dtoverlay=pwm.

rpi: reboot #

$ sudo reboot

host: install cross-compiling toolchain #

$ sudo apt install gcc-arm-linux-gnueabihf